﻿<%@ Page Language="C#"%> 
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../../lib/jquery/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../../lib/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
    <script src="../../lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
    <script type="text/javascript">
        function f_onSelect(row)
        {
            //document.write(row.id);
        }
    </script>
    <style type="text/css">
        body{ padding:8px;}
    </style>
</head>
<body> 
    <%
        var defaultData = new
        {
            Rows = new object[]{
                new {city = "广州" , id = 100},
                new {city = "北京" , id = 101},
                new {city = "上海" , id = 102},
                new {city = "深圳" , id = 103} 
            }
        };
    %>   
      <% =Liger.Web.UI.UIComponent.Create().Grid()
        .Manager("grid")
        .FullScreen()
        .Title("我的表格")
        .Editable() 
        .Pageable(c => c.PageSizeOptions(new[] { 1, 2, 10, 20 }).PageSize(2)) 
        .Columns(columns =>
            {
                columns.Add("id").Display("标示").Editor(editor =>
                    {
                        editor.Select(new object[]{
                            new { id = 100 , text = "100"},
                            new { id = 101 , text = "101"}
                        });
                    });
                columns.Add("city").Display("城市").Width(200).Set("www",44);
                columns.Add("city").Display("城市").Width(200);
                columns.Add("city").Display("城市").Width(300);
            })
        .Data(defaultData)
                  .Detail("id", "OrderID", grid => 
                      {
                          grid.Name("detailgrid")
                          .Ajax(ajax => ajax.Enabled(true).URL("get.aspx").SortName("id"))
                          .Columns(c =>
                          {
                              c.Add("id");
                          })
                          .Width("80%")
                          .Height(100)
                          .Setting(c => c.SwitchPageSizeApplyComboBox(false));
                      }
                 )
        .Bind("selectRow", "f_onSelect")
    %>  
</body>
</html>
